{
  "properties" : { },
  "id" : "9268fa865608401cb85a580a56c748cc",
  "script" : null,
  "groupId" : "832da851b4034ccdb63b69855a4390ac",
  "name" : "新增或保存属性配置",
  "createTime" : 1727070865887,
  "updateTime" : 1726304229919,
  "lock" : "1",
  "createBy" : "ndmp",
  "updateBy" : "ndmp",
  "path" : "submit",
  "method" : "POST",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "{\r\n\"name\":\"ceuis\"}",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : "{\n    \"code\": 500,\n    \"success\": false,\n    \"data\": {},\n    \"msg\": \"系统维护中，请稍后重试。\"\n}",
  "description" : "",
  "requestBodyDefinition" : {
    "name" : "",
    "value" : { },
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ ]
  },
  "responseBodyDefinition" : {
    "name" : "",
    "value" : "",
    "description" : "",
    "required" : false,
    "dataType" : "String",
    "type" : "",
    "defaultValue" : "",
    "validateType" : "",
    "error" : "",
    "expression" : "",
    "children" : [ {
      "name" : "code",
      "value" : "500",
      "description" : "",
      "required" : false,
      "dataType" : "Integer",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "success",
      "value" : "false",
      "description" : "",
      "required" : false,
      "dataType" : "Boolean",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "data",
      "value" : "",
      "description" : "",
      "required" : false,
      "dataType" : "Object",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    }, {
      "name" : "msg",
      "value" : "系统维护中，请稍后重试。",
      "description" : "",
      "required" : false,
      "dataType" : "String",
      "type" : "",
      "defaultValue" : "",
      "validateType" : "",
      "error" : "",
      "expression" : "",
      "children" : [ ]
    } ]
  }
}
================================
import com.kd.ndmp.util.IdUtil


if (body.id == null) {
    return db.table('ndmp_dynamic_model_attribute').primary('id').insert({
        id: IdUtil.getSnowflakeNextId(),
        name: body.name,
        from_field: body.fromField,
        from_table: body.fromTable,
        from_db: body.fromDb,
        count: body.count,
        date_formatter: body.dateFormatter,
        width: body.width,
        min_width: body.minWidth,
        sort: body.sort,
        english_name: body.englishName
    })
} else {

    return db.table('ndmp_dynamic_model_attribute').primary('id').update({
        id: body.id,
        name: body.name,
        from_field: body.fromField,
        from_table: body.fromTable,
        from_db: body.fromDb,
        count: body.count,
        date_formatter: body.dateFormatter,
        width: body.width,
        min_width: body.minWidth,
        sort: body.sort,
        english_name: body.englishName
    })
}
